//
//  LGProfileController.m
//  微博
//
//  Created by MS on 15-12-3.
//  Copyright (c) 2015年 MS. All rights reserved.
//

#import "LGProfileController.h"
#import "BasicSetting.h"
#import "LGProfileCell.h"
#import "LGSettingController.h"
@interface LGProfileController ()

@end

@implementation LGProfileController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setUpNav];
   
    [self setUpGroup0];
    [self setUpGroup1];
    [self setUpGroup2];
    [self setUpGroup3];
}


-(void) setUpGroup0
{
    LGArrowItem * arrowItem = [LGArrowItem itemWithImage:[UIImage imageNamed:@"new_friend"] title:@"新的好友"];
    
    LGGroups * group = [[LGGroups alloc] init];
    group.items = @[arrowItem];
    [self.groups addObject:group];
    
}

-(void) setUpGroup1
{
    LGArrowItem * album = [LGArrowItem itemWithImage:[UIImage imageNamed:@"album"] title:@"我的相册"];
    album.subTitle = @"(10)";
    
     LGArrowItem * collect = [LGArrowItem itemWithImage:[UIImage imageNamed:@"collect"] title:@"我的收藏"];
    collect.subTitle = @"(8)";
    
     LGArrowItem * like = [LGArrowItem itemWithImage:[UIImage imageNamed:@"like"] title:@"赞"];
     like.subTitle = @"(88)";
    LGGroups * group = [[LGGroups alloc] init];
    group.items = @[album,collect,like];
    [self.groups addObject:group];
    
}

-(void) setUpGroup2
{
    LGArrowItem * pay = [LGArrowItem itemWithImage:[UIImage imageNamed:@"pay"] title:@"微博支付"];
   
    
    LGArrowItem * vip = [LGArrowItem itemWithImage:[UIImage imageNamed:@"vip"] title:@"个性化"];
    vip.subTitle = @"微博来源、皮肤、封面图";

    LGGroups * group = [[LGGroups alloc] init];
    group.items = @[pay,vip];
    [self.groups addObject:group];
    
}

-(void) setUpGroup3
{
    LGArrowItem * card = [LGArrowItem itemWithImage:[UIImage imageNamed:@"card"] title:@"我的二维码"];
    
    
    LGArrowItem * draft = [LGArrowItem itemWithImage:[UIImage imageNamed:@"draft"] title:@"草稿箱"];
   
    
    LGGroups * group = [[LGGroups alloc] init];
    group.items = @[card,draft];
    [self.groups addObject:group];
    
}


-(void)setUpNav
{
     self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"设置" style:UIBarButtonItemStyleDone target:self action:@selector(setting)];
}

-(void)setting
{
    LGSettingController * vc = [[LGSettingController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
    
  //  LGLog(@"%s",__func__);
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    LGGroups * groups = self.groups[indexPath.section];
    LGItem * item = groups.items[indexPath.row];
    
    LGProfileCell * cell = [LGProfileCell cellWithTableView:tableView];
    
    cell.item =item;
    
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
